package com.jk.vehicle.mini.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.jk.vehicle.core.entity.BaseEntity;
import java.util.Date;
import javax.persistence.*;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ApiModel("人员数据")
@Data
public class User extends BaseEntity {
    /**
     * 人员昵称
     */
    @ApiModelProperty("人员昵称")
    private String name;

    /**
     * 人员微信openId
     */
    @ApiModelProperty("人员微信openId")
    @Column(name = "wx_id")
    private String wxId;

    /**
     * 电话号码
     */
    @ApiModelProperty("电话号码")
    private String phone;

    /**
     * 邮箱
     */
    @ApiModelProperty("邮箱")
    private String email;

    /**
     * 头像地址
     */
    @ApiModelProperty("头像地址")
    @Column(name = "avatar_url")
    private String avatarUrl;

    /**
     * 性别 0 未知 1 男 2 女
     */
    @ApiModelProperty("性别 0 未知 1 男 2 女")
    private Byte gender;

    /**
     * 用户所在国家
     */
    @ApiModelProperty("用户所在国家")
    private String country;

    /**
     * 用户所在省份
     */
    @ApiModelProperty("用户所在省份")
    private String province;

    /**
     * 用户所在城市
     */
    @ApiModelProperty("用户所在城市")
    private String city;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @Column(name = "create_date")
    private Date createDate;

    /**
     * 创建人ID
     */
    @ApiModelProperty("创建人ID")
    @Column(name = "create_user")
    private Long createUser;

    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    @Column(name = "update_date")
    private Date updateDate;

    /**
     * 更新人id
     */
    @ApiModelProperty("更新人id")
    @Column(name = "update_user")
    private Long updateUser;

    public static final class UserBuilder {
        private String name;
        private Long id;
        private Byte delFlag = 0;
        private String wxId;
        private String phone;
        private String email;
        private String avatarUrl;
        private Byte gender;
        private String country;
        private String province;
        private String city;
        private Date createDate;
        private Long createUser;
        private Date updateDate;
        private Long updateUser;

        private UserBuilder() {
        }

        public static UserBuilder anUser() {
            return new UserBuilder();
        }

        public UserBuilder withName(String name) {
            this.name = name;
            return this;
        }

        public UserBuilder withId(Long id) {
            this.id = id;
            return this;
        }

        public UserBuilder withDelFlag(Byte delFlag) {
            this.delFlag = delFlag;
            return this;
        }

        public UserBuilder withWxId(String wxId) {
            this.wxId = wxId;
            return this;
        }

        public UserBuilder withPhone(String phone) {
            this.phone = phone;
            return this;
        }

        public UserBuilder withEmail(String email) {
            this.email = email;
            return this;
        }

        public UserBuilder withAvatarUrl(String avatarUrl) {
            this.avatarUrl = avatarUrl;
            return this;
        }

        public UserBuilder withGender(Byte gender) {
            this.gender = gender;
            return this;
        }

        public UserBuilder withCountry(String country) {
            this.country = country;
            return this;
        }

        public UserBuilder withProvince(String province) {
            this.province = province;
            return this;
        }

        public UserBuilder withCity(String city) {
            this.city = city;
            return this;
        }

        public UserBuilder withCreateDate(Date createDate) {
            this.createDate = createDate;
            return this;
        }

        public UserBuilder withCreateUser(Long createUser) {
            this.createUser = createUser;
            return this;
        }

        public UserBuilder withUpdateDate(Date updateDate) {
            this.updateDate = updateDate;
            return this;
        }

        public UserBuilder withUpdateUser(Long updateUser) {
            this.updateUser = updateUser;
            return this;
        }

        public User build() {
            User user = new User();
            user.setName(name);
            user.setId(id);
            user.setDelFlag(delFlag);
            user.setWxId(wxId);
            user.setPhone(phone);
            user.setEmail(email);
            user.setAvatarUrl(avatarUrl);
            user.setGender(gender);
            user.setCountry(country);
            user.setProvince(province);
            user.setCity(city);
            user.setCreateDate(createDate);
            user.setCreateUser(createUser);
            user.setUpdateDate(updateDate);
            user.setUpdateUser(updateUser);
            return user;
        }
    }
}